//
//  HomeNavView.swift
//

import UIKit

class HomeNavView: UIView {

    private lazy var iconImageView: UIImageView = {
        let view = UIImageView()
        view.image = "age_select_icon".image
        return view
    }()
    
    private lazy var ageLabel: UILabel = {
        let view = UILabel()
        view.text = " 0-3岁"
        view.textColor = .titleColor
        view.font = 12.font
        return view
    }()
    
    private lazy var arrowImageView: UIImageView = {
        let view = UIImageView()
        view.image = "home_age_select_down".image
        return view
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        addSubviews()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func addSubviews() {
        addSubview(iconImageView)
        addSubview(ageLabel)
        addSubview(arrowImageView)
        
        iconImageView.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalToSuperview()
            make.size.equalTo(CGSize(width: 26, height: 26))
        }
        
        ageLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(iconImageView.snp.right)
        }
        
        arrowImageView.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(ageLabel.snp.right)
        }
    }
}
